#include "hpy.h"
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char* argv[])
{
    registerGen(argc, argv, 1);
    auto [n, m, p] = tuple{opt<int>(1), opt<int>(2), opt<double>(3)};
    println(n, m);
    for(int i = 1; i <= n; i ++) {
        if(rnd.next() < p) {
            int a = rnd.next(1, m), b = rnd.next(1, m);
            while(a >= b) a = rnd.next(1, m), b = rnd.next(1, m);
            println(2, a, b);
        }else{
            println(1, rnd.next(1, m));
        }
    }
}
